package com.twentytwok.hospitalsystem22K.mapper;

import com.twentytwok.hospitalsystem22K.bo.DoctorBo;
import com.twentytwok.hospitalsystem22K.pojo.DoctorUser;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

public interface DoctorUserMapper {

    List<DoctorUser> selectByParams(Map<String, Object> params);

    int update(DoctorUser doctorUser);

    int delete(Integer id);

    int add(DoctorUser doctorUser);

    @Select("select * from doctor_user where department_id = #{departmentId}")
    List<DoctorUser> selectByDepartmentId(@Param("departmentId") Integer departmentId);

    @Select("select department_name as name,count(*) as value from doctor_user,department where doctor_user.department_id = department.id GROUP BY department_id")
    List<DoctorBo> selectDepartment();
}
